<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>管理员界面</title>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"><!-- 导入bootstrap -->
<script src="https://code.jquery.com/jquery.js"></script><!-- 导入JQuery方便使用ajax插件 -->
<script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script><!-- 导入bootstrap核心js文件 -->
</head>
<body>
<nav class="navbar navbar-default navbar-static-top">
  <div class="container-fluid">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>                        
      </button>
      <a id="a1" class="navbar-brand" style='padding-left:300px;color:red' href="/ProfessionalDesign/Managerlogin">亲，请登录</a>
    </div>
    <div class="collapse navbar-collapse" id="myNavbar">
      <ul class="nav navbar-nav" style="padding-left:100px">
        <li><a class="manage" href="/ProfessionalDesign/Manage?m_id=${managerinfo}">待处理</a></li>
        <li><a class="manage" href="/ProfessionalDesign/shopmanage?m_id=${managerinfo}">管理商铺</a></li>
        <li><a class="manage" href="/ProfessionalDesign/usermanage?m_id=${managerinfo}">用户管理</a></li>
        <li><a class="manage" href="/ProfessionalDesign/goodsmanage?m_id=${managerinfo}">商品管理</a></li>
        <li><a class="manage" href="/ProfessionalDesign/commentmanage?m_id=${managerinfo}">评论管理</a></li>
      </ul>
    </div>
  </div>
</nav>
 
<div class="container">
  <div class="row">
    <div class="col-sm-2">
      <h2>所有用户</h2>
    </div>
    <div class="col-sm-10">
      <h2>用户列表</h2>
          <div class="row clearfix">
        <div class="col-md-12 column">
            <table class="table table-hover table-striped">
                <thead>
                <tr>
                    <th>用户ID</th>
                    <th>昵称</th>
                    <th>性别</th>
                    <th>邮箱</th>
                    <th>状态</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody id="tbody">
                </tbody>
            </table>
        </div>
    </div>
    </div>
  </div>
</div>
 
<div class="jumbotron text-center" style="margin-top:100px;margin-bottom:0">
  <br>
  <p>© 2022 ProfessionalDesign.com 版权所有</p>
  <a>关于我们</a>|
  <a>合作伙伴</a>|
  <a>营销中心</a>|
  <a>联系客服</a>|
  <a>开放平台</a>|
  <a>诚征英才</a>|
  <a>联系我们</a>|
  <a>网站地图</a>|
  <a>法律声明及隐私权政策</a>
</div>
</body>
<style>

.navbar-default .navbar-brand:hover,
.navbar-default .navbar-brand:focus {
    color: red;
}
.navbar-default .navbar-nav>li>a:hover,
.navbar-default .navbar-nav>li>a:focus {
    color: red;
}

</style>
<script>
$(function(){
	if(${managerinfo}!=null){
		$('#a1').text('欢迎您，管理员编号' + ${managerinfo});
		}else{
			$("a").attr("href","${pageContext.request.contextPath}/Managerlogin");	
		}
	}
	)
</script>
<script type="text/javascript">
$.ajax({     
	url: "/ProfessionalDesign/userinf"
	,type:'POST',dataType:'json'
	,async : true
	,success: function(data){
	console.log("data1数据接收");
	$(data).each(function(){
		$('#tbody').append(" <tr>\n" +
                "                        <td>"+this.userid+"</td>\n" +
                "                        <td>"+this.username+"</td>\n" +
                "                        <td>"+this.sex+"</td>"+
                "                        <td>"+this.email+"</td>\n" +
                "                        <td>"+this.state+"</td>\n" +
                "                        <td>\n" +
                "                            <a href=\"${pageContext.request.contextPath}/sealUser?id="+this.userid+"&m_id=${managerinfo}"+"\">封禁</a>\n" +
                "                             &nbsp;" +
                "                            <a href=\"${pageContext.request.contextPath}/queryComments?id="+this.userid+"&m_id=${managerinfo}"+"\">查看评论</a>\n" +
                "                        </td>\n" +
                "                    </tr>");
	}) 
    }
})
</script>
</html>